<template>
	<div>
		<el-row>
			<el-form class="demo-ruleForm">
				<el-col :span="2">
					<el-button @click="UserList">刷新</el-button>
				</el-col>
			</el-form>
		</el-row>
		<el-table :data="tableData" style="width: 100%" :height="780">
			<el-table-column label="序号" width="60" prop="id"></el-table-column>
			<el-table-column label="手机号" width="110" prop="mobilePhone"></el-table-column>
			<el-table-column label="预约结果" width="110" prop="status"></el-table-column>
			<el-table-column label="预约商品" width="200" prop="itemCode"></el-table-column>
			<el-table-column label="图片" width="200" prop="picture">
				<template slot-scope="scope">
					<img :src="scope.row.picture" min-width="80" height="80" />
				</template>
			</el-table-column>
			<el-table-column label="预约时间" width="150" prop="createTime">
				<template slot-scope="scope">{{ scope.row.createTime | dateYMDHMSFormat }}</template>
			</el-table-column>

			<el-table-column label="预约明细" prop="response"></el-table-column>
		</el-table>
		<el-row>
			<el-pagination background :current-page="params.pageIndex" :page-size="params.pageSize" layout="prev, pager, next" :total="total" :pager-count="5" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
		</el-row>
	</div>
</template>

<script>
import request from '@/utils/request';
export default {
	data() {
		return {
			tableData: [],
			total: 0,
			params: {
				pageIndex: 1,
				pageSize: 10,
			},

			search: '',
		};
	},
	created() {
		this.UserList();
	},
	methods: {
		UserList() {
			var data = this.params;
			request({
				url: '/api/main/loglist',
				method: 'post',
				data,
			})
				.then((result) => {
					var data = result.data.data;
					this.tableData = data.data;
					this.total = data.total;
					// console.log(data);
				})
				.catch((err) => {
					console.log(err);
				});
		},
		handleEdit(index, row) {
			console.log(index, row);
		},
		handleDelete(index, row) {
			console.log(index, row);
		},
		handleSizeChange() {
			console.log('handleSizeChange');
		},
		handleCurrentChange(val) {
			this.params.pageIndex = val;
			this.UserList();
			console.log(val);
		},
	},
};
</script>
<style scoped>
[class*='el-col-'] {
	padding: 10px;
}
</style>
